package cloud.demarcia.rabbitregister.exception;

import cloud.demarcia.rabbitregister.enums.RegisterStatusCode;

/**
 * @author Bojun Wen, wen_bj@outlook.com
 * @date 2022.02.17
 */
public class RabbitRegisterException extends RuntimeException {
    RegisterStatusCode registerStatusCode;
    public RabbitRegisterException(RegisterStatusCode code) {
        super(code.getMessage());
        this.registerStatusCode =code;
    }
    public int getErrorCode() {
        return registerStatusCode.getCode();
    }

    public String getErrorMessage() {
        return registerStatusCode.getMessage();
    }
}
